package com.ch.engine.statemachine;

import com.ch.engine.statemachine.enums.Event;
import com.ch.engine.statemachine.enums.State;
import com.ch.engine.statemachine.handler.IStateHandler;
import com.ch.engine.statemachine.machine.NewStateMachine;

/**
 * 新状态机测试
 */
public class NewMachineTest {
    public static void main(String[] args) {
        State from = State.HR_CHECK;
        Event event = Event.PASS;

        System.out.println("当前状态：" + from);
        System.out.println("当前动作：" + event);

        NewStateMachine newStateMachine = new NewStateMachine();
        State nextState = newStateMachine.getNext(from, event);
        System.out.println("下一个状态：" + nextState);

        IStateHandler stateHandler = newStateMachine.getHandle(from, event);
        System.out.print("处理过程：");
        String handleResult = stateHandler.handle();
        System.out.println("处理结果：" + handleResult);
    }
}
